<?php
/*!
 * @version		$Id: database.cfg.php 8841 2007-12-07 20:14:22Z $
 * @package		diduo
 * @link        http://www.diduo.net
 * @author      moolao <moolao@diduo.net>
 * @abstract    database.cfg.php
 * @copyright	Copyright (C) 2007 - 2008 diduo.net development team. All rights reserved.
 */
/**#@++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
echo '<pre><a href="spyc.yaml">spyc.yaml</a> loaded into PHP:<br/>';
print_r($array);
echo '</pre>';
display result:
Array
(
    [database] => Array
        (
            [adapter] => mysql
            [database] => diduo
            [username] => root
            [password] => test
            [host] => localhost
            [encoding] => utf-8
        )

)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=*/

// no direct access
defined( '_DEXEC' ) or die( 'Restricted access' );

// set the directory separator
defined( 'DS' ) || define( 'DS', DIRECTORY_SEPARATOR );

require( DPATH_ROOT. DS. 'common/yaml.class.php' );

// parse database configuration file
$obj = new Settings_YAML();
$arr = $obj->load(DPATH_CONFIGURATION. DS.'database.yml');

@define( 'ADAPTER' ,   $arr[database][adapter] );
@define( 'HOST_ADDR' , $arr[database][host] );
@define( 'HOST_USER',  $arr[database][username] );
@define( 'HOST_PSW',   $arr[database][password] );
@define( 'DB_NAME' ,   $arr[database][database] );
?>	